package com.yidian.controller;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author whb
 * @create 2021-10-22 14:21
 * @desciption 辅助跳转控制类
 */
@Controller
@RequestMapping("/redirect")
public class RedirectController {
    @RequestMapping("/back")
    public String back(@RequestHeader(value = "referer",required = false) String refer){
        if (!StringUtils.isEmpty(refer)){
            return "redirect:"+refer;
        }
        return "/seckill-index.html";
    }
}
